package com.snopy.ribbon.config;

import com.netflix.loadbalancer.*;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author snopy
 * @version 1.0.0
 * @classname RibbonRuleConfig
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/11 11:20
 */
@Configuration
@RibbonClient(value = "ribbon-consumer",configuration = RibbonRuleConfig.class)
public class RibbonRuleConfig {
    @Bean
    public IRule getIRule(){
        return new RandomRule();
    }
    /*@Bean
    public ILoadBalancer getILoadBalancer(){
        return new BaseLoadBalancer();
    }*/
    public IPing ribbonPing(){
        return new PingUrl();
    }
}
